@extends('home.inc.common')
@section('title')
        <title>
            {{$user->nickname}}的主页-奇异果聚合
        </title>
        <meta name="keywords" content="{{$user->nickname}}" />
        <meta name="description" content="{{$user->nickname}}的主页" />
        <link href="{{asset('home_new/css/libs.css')}}" rel="stylesheet" type="text/css" />
        <link href="{{asset('home_new/css/global.css')}}" rel="stylesheet" type="text/css" />
        <link href="{{asset('home_new/css/page2.css')}}" rel="stylesheet" type="text/css" />
        <link href="{{asset('home_new/css/page_article.css')}}" rel="stylesheet" type="text/css" />
        <link href="{{asset('home_new/css/page_author.css')}}" rel="stylesheet" type="text/css" />
        <link href="{{asset('home_new/css/qyg2016.css')}}" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="{{asset('home/js/jquery-3.1.0.min.js')}}"></script>
@endsection
@section('content')
    <style>
        .pagination li{
            float:left;
        }
        .active a{
            color: #fff;
            background-color: #2EB872;
        }
    </style>
            <div class="wrap">
                <div class="personal_main clear">
                    <div class="per_header_main clear">
                        <div class="header_pic clear">
                            <div class="user_logo_grade global_user big clear">
                                @if(!empty($user->head_img))
                                    <img src="{{route('image', [trim($user->head_img, '/'), '80x80'])}}" onerror="this.src='{{asset('img/200200.png')}}'" alt="头像">
                                @else
                                    <img src="{{asset('img/200200.png')}}"  alt="头像">
                                @endif
                                <span class="global_user_level level_blue_8">
                                </span>
                            </div>
                            <div class="header_score_wrap">
                                <div class="score_arrow">
                                </div>
                                <div class="user_score">
                                    <span>
                                        2859
                                    </span>
                                    &nbsp;/
                                    <span>
                                        5000
                                    </span>
                                </div>
                            </div>
                        </div>
                        <div class="header_center">
                            <div class="user_name clear">
                                <div class="name_wrap">
                                    {{$user->nickname}}
                                </div>
                                <span class="user_award">
                                </span>
                            </div>
                            <div class="user_des">
                                @if($user->intro)
                                    {{$user->intro}}
                                @else
                                    作者很懒，什么也没有留下~
                                @endif
                            </div>
                            <div class="user_info">
{{--                                <span class="user_sex personal_logo">
                                    男
                                </span>--}}
                                <s class="global_grey_icons grey_time">
                                </s>
                                <span class="user_zealer_old">
                                    果龄{{ceil((time()-strtotime($user->created_at))/(3600*24))}}天
                                </span>
                            </div>
                        </div>
                        <div class="user_number">
                            <a class="reply_number">
                                <div class="reply_logo personal_logo">
                                </div>
                                <div class="reply_text">
                                    粉丝
                                </div>
                                <div class="reply_num">
                                    {{ $user->followUser()->count() }}
                                </div>
                            </a>
                            <a class="post_number">
                                <div class="post_logo personal_logo">
                                </div>
                                <div class="post_text">
                                    发帖
                                </div>
                                <div class="post_num">
                                    {{ $user->archives()->count() }}
                                </div>
                            </a>
                        </div>
                    </div>
                    <div class="per_main_wrap clear">
                        <div class="useTag_wrap clear" style="margin-top:30px;">
                            <h2>
                                TA的标签
                            </h2>
                            <div class="join_tags clear">
                                @if($tags)
                                    @foreach($tags as $v)
                                        <a href="{{$v->url}}" target="_blank" class=" clear"><span class="tag_name">{{$v->name}}</span></a>
                                    @endforeach
                                @endif
                            </div>
                        </div>
                        <div class="various_post_wrap" data-uid="421174">
                            <h2 class="clear">
                                <a class="sub_title @if(empty($type))active @endif" data-type="great" style="" href="{{ route('author.index', [$user->id]) }}">
                                    全部
                                </a>
                                <a class="sub_title @if($type=='video')active @endif" data-type="post" href="{{ route('author.index', [$user->id]).'?type=video' }}">
                                    视频
                                </a>
                                <a class="sub_title @if($type=='article')active @endif" data-type="reply" href="{{ route('author.index', [$user->id]).'?type=article' }}">
                                    文章
                                </a>
                                <a class="sub_title @if($type=='gallery')active @endif" data-type="vote" href="{{ route('author.index', [$user->id]).'?type=gallery' }}">
                                    图集
                                </a>
                            </h2>
                            <div class="various_content_wrap" data-total="24">
                                <div class="personal_inner_wrap clear" data-pos="no" data-page="1" data-totalnum="24">
                                    <div class="great_post_wrap" data-page="1" data-totalnum="24">
                                        @foreach($archives as $v)
                                        <div class="list_inner clear">
                                            <a target="_blank" href="http://plus.zealer.com/post/4641.html" class="inner_left">
                                                <div class="comments">
                                                    评论
                                                </div>
                                                <div class="comments comment_nums">
                                                    <span id = "sourceId::{{$v->id}}" class = "cy_cmt_count" ></span>
                                                    <script id="cy_cmt_num" src="http://changyan.sohu.com/upload/plugins/plugins.list.count.js?clientId=cyrlo1kOL">
                                                    </script>
                                                </div>
                                            </a>
                                            <div class="inner_right clear">
                                                <a href="{{route($v->type->name.'.show', [$v->id])}}" id="right_title" target="_blank" class="color_black">
                                                    {{$v->title}}
                                                </a>

                                                    @if($v->archive_type_id==3)
                                                    <div class="img_content clear" style="width: auto">
                                                                <a href="{{route($v->type->name.'.show', [$v->id])}}" class="img_content" target="_blank" style="margin-right: 20px;">
                                                                    <img src="{{route('image', [trim($v->cover, '/'), '120x80'])}}"
                                                                         alt="">
                                                                </a>
                                                    </div>
                                                    @elseif($v->archive_type_id==2)
                                                    <div class="img_content clear" style="width: auto">
                                                            @foreach($v->images()->take(4)->get() as $image)
                                                                    <a href="{{route($v->type->name.'.show', [$v->id])}}" class="img_content" target="_blank" style="margin-right: 20px;">
                                                                        <img src="{{route('image', [trim($image->url, '/'), '120x80'])}}"
                                                                             alt="">
                                                                    </a>
                                                            @endforeach
                                                    </div>
                                                    @endif

                                                <div class="right_tips">
                                                    <span class="post_creatTime global_grey_icons">
                                                        {{worldTime(strtotime($v->updated_at))}}
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                        @endforeach
                                        <div class="index_page page_center">
                                            <div class="global_page">
                                                {{$archives->links()}}
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
@endsection